package cn.kgc.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 课工场
 * @Version: v1.0  2023/7/3
 * @Description:
 */
@RestController
@RequestMapping("config")
@RefreshScope   // 实现自动刷新
public class ConfigController {

    @Value("${age}")
    private Integer age;

    @GetMapping
    public String method(){

        return "age = "+age;
    }
}
